#include "widget.h"
#include "ui_widget.h"



Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    connect(ui->push_button_01, &QPushButton::clicked, this, [=]() {
        QColor color = QColorDialog::getColor();

        QBrush brush(color);
        QRect rect(0, 0, ui->label->width(), ui->label->height());
        QPixmap pix(rect.width(), rect.height());
        QPainter p(&pix);
        p.fillRect(rect, brush);

        ui->label->setPixmap(pix);

        qDebug() << color.red() << " " << color.green() << " " << color.blue() << endl;
    });
}

Widget::~Widget()
{
    delete ui;
}

